import 'package:flutter_test/flutter_test.dart';
import 'package:demoone/demoone.dart';
import 'package:demoone/demoone_platform_interface.dart';
import 'package:demoone/demoone_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockDemoonePlatform
    with MockPlatformInterfaceMixin
    implements DemoonePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final DemoonePlatform initialPlatform = DemoonePlatform.instance;

  test('$MethodChannelDemoone is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelDemoone>());
  });

  test('getPlatformVersion', () async {
    Demoone demoonePlugin = Demoone();
    MockDemoonePlatform fakePlatform = MockDemoonePlatform();
    DemoonePlatform.instance = fakePlatform;

    expect(await demoonePlugin.getPlatformVersion(), '42');
  });
}
